load("@rules_rust//rust:defs.bzl", "rust_library", "rust_test")

package(default_visibility = ["//visibility:public"])

DEPENDENCIES = [
    # Keep sorted.
    "//packages/ic-error-types",
    "//packages/icrc-ledger-client:icrc_ledger_client",
    "//packages/icrc-ledger-client-cdk:icrc_ledger_client_cdk",
    "//packages/icrc-ledger-types:icrc_ledger_types",
    "//rs/ledger_suite/common/ledger_core",
    "//rs/nervous_system/canisters",
    "//rs/nervous_system/common",
    "//rs/nervous_system/proxied_canister_calls_tracker",
    "//rs/nervous_system/runtime",
    "//rs/rust_canisters/dfn_candid",
    "//rs/rust_canisters/dfn_core",
    "//rs/types/base_types",
    "//rs/types/management_canister_types",
    "//rs/utils",
    "@crate_index//:candid",
    "@crate_index//:num-traits",
    "@crate_index//:serde",
]

DEV_DEPENDENCIES = DEPENDENCIES + [
    "@crate_index//:futures",
    "@crate_index//:rand",
    "@crate_index//:tokio",
]

MACRO_DEPENDENCIES = [
    # Keep sorted.
    "@crate_index//:async-trait",
]

rust_library(
    name = "clients",
    srcs = glob(["src/**/*.rs"]),
    crate_name = "ic_nervous_system_clients",
    proc_macro_deps = MACRO_DEPENDENCIES,
    version = "0.0.1",
    deps = DEPENDENCIES,
)

rust_test(
    name = "clients_test",
    crate = ":clients",
    deps = DEV_DEPENDENCIES,
)
